<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@taglib prefix="sj" uri="/struts-jquery-tags"%>
<%@taglib prefix="sjg" uri="/struts-jquery-grid-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<script type="text/javascript">
function formatLink(cellvalue, options, rowObject) {
    return "<a href='#' onClick='javascript:openDialog()'>edit roles</a>";
}
function openDialog() {
    $("#mybuttondialog").dialog('open');
}
function okButton() {
	$('#mybuttondialog').dialog('close');
};
function cancelButton() {	
	$('#mybuttondialog').dialog('close');
};
</script>
</head>
<body>
 <sj:dialog 
    	id="mybuttondialog" 
    	buttons="{ 
    		'OK':function() { okButton(); },
    		'Cancel':function() { cancelButton(); } 
    		}" 
    	autoOpen="false" 
    	modal="true" 
    	title="Dialog with Buttons"
    >
     <s:form theme="simple">     	
     	<div>
     		<s:checkbox name="funder">Funder</s:checkbox>
     		<br>
     		<s:checkbox name="lead">Lead</s:checkbox>
     		<br>
     		<s:checkbox name="dilivery">Delivery</s:checkbox>
     		<br>
     		<s:checkbox name="auditor">Auditor</s:checkbox>
     	</div>
     </s:form>    
    </sj:dialog>
	<s:url id="getOrganisationUrl" action="getOrganisationAction"/>
	<s:form theme="simple">
		<s:url id="getOrganisationUrl" action="getOrganisationAction" />
		<sjg:grid id="gridtable" dataType="json" caption="Organisation"
			href="%{getOrganisationUrl}" pager="true" gridModel="gridModel"
			rowNum="15" rownumbers="true">
			<sjg:gridColumn name="organisationName" index="organisationName"
				title="Organisation Name" sortable="false" />
			<sjg:gridColumn name="description" index="description"
				title="Description" sortable="false" />
			<sjg:gridColumn name="roles" index="roles" title="Roles"
				sortable="false" />
			<sjg:gridColumn name="editRoles" index="editRoles" title="Edit Roles"
				formatter="formatLink" />
		</sjg:grid>
	</s:form>
</body>
</html>